<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> 
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>试卷内容</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<link rel="stylesheet" type="text/css" href="css/main.css" />
	
	<script type="text/javascript">
	function showOrHiddenAnswer() {
		var panduan_num = document.getElementById("panduan_num").value;
		var xuanze_num = document.getElementById("xuanze_num").value;
		var tiankong_num = document.getElementById("tiankong_num").value;
		
		for(var i=0; i<panduan_num; i++){
			if( document.getElementById("panduan_"+i).style.display == 'none' ){
				document.getElementById("panduan_"+i).style.display = '';
			}else{
				document.getElementById("panduan_"+i).style.display = 'none';
			}
		}
		for(var i=0; i<xuanze_num; i++){
			if( document.getElementById("xuanze_"+i).style.display == 'none' ){
				document.getElementById("xuanze_"+i).style.display = '';
			}else{
				document.getElementById("xuanze_"+i).style.display = 'none';
			}
		}
		for(var i=0; i<tiankong_num; i++){
			if( document.getElementById("tiankong_"+i).style.display == 'none' ){
				document.getElementById("tiankong_"+i).style.display = '';
			}else{
				document.getElementById("tiankong_"+i).style.display = 'none';
			}
		}
	}
	</script>
	
  </head>
  
  <body>
  	<%@ include file="header.jsp" %>
    
    <DIV id=tips>
		<P class=tips_left>
			您的位置：<A>首页</A> 
			&gt;&gt; <A>考试管理</A>
			&gt;&gt; <A>试卷内容</A>
		</P>
	</DIV>
		
	<DIV id=container>
		<DIV id=list_left>
			<%@ include file="left_exam.jsp" %>
		</DIV>
		<DIV id=list_right>
			<DIV id=subnav>
				<UL class=subnav_ul1></UL>
				<UL class=subnav_ul2>
					<DIV class=subnav_t>
						<P class=subnav_tl>试卷内容</P>
  						<P class=subnav_tr></P>
  					</DIV>
  					<DIV class=subnav_nr>
  						<table width="700" align="center" border="0" cellpadding="0" cellspacing="0">
							<tr>
					        	<td class="row_title" colspan="5">
					        		${paper.title}
					        	</td>
					        	<td></td>
					        </tr>
					        <tr>
					        	<td width="7%"></td>
					        	<td width="13%"></td>
					        	<td class="row_subTitle" width="25%">
					        		考试科目：<a style="color:blue">${subjectName}</a>
					        	</td>
					        	<td class="row_subTitle" width="25%">
					        		岀卷老师：<a style="color:blue">${teacherName}</a>
					        	</td>
					        	<td width="30%"></td>
					        </tr>
					        <tr>
					        	<td></td>
					        	<td></td>
					        	<td class="row_subTitle">
					        		平均难度：<a style="color:blue">${paper.difficulty}</a>
					        	</td>
					        	<td class="row_subTitle">
					        		试卷总分：<a style="color:blue">${paper.total_score}</a>
					        	</td>
					        	<td>
					        		<input class="row_btn" type="button" value="显示/隐藏答案" onClick="javascript:showOrHiddenAnswer()" />
					        	</td>
					        </tr>
					        <tr>
					        	<td class=row_question_type colspan="4">
					        		一、判断题(共${paper.panduan_num}题)：
					        		<input type="hidden" name="panduan_num" value="${paper.panduan_num}" />
					        	</td>
					        </tr>
							<c:forEach items="${panduanList}" var="panduan" varStatus="status">
							<tr>
					        	<td class="row_name" colspan="5">
					        		<c:out value="${status.index + 1}" />.&nbsp;(${panduan.score}分)&nbsp;
					        		${panduan.description}
					        	</td>
							</tr>
							<tr>
								<td></td>
					        	<td class="row_name" colspan="3">
					        		<input type="radio" name="user_answer_${status.index}" value="1"/>T
									<input type="radio" name="user_answer_${status.index}" value="0"/>F
					        	</td>
					        	<td class="important_message">
					        		<div id="panduan_${status.index}" style="display:none">
					        		正确答案：
				 					<c:if test="${panduan.correct_answer == 1}">T</c:if>
				 					<c:if test="${panduan.correct_answer == 0}">F</c:if>
				 					</div>
					        	</td>
							</tr>
							</c:forEach>
							<tr><td><br/></td></tr>
							<tr>
					        	<td class=row_question_type colspan="5">
					        		二、选择题(共${paper.xuanze_num}题)：
					        		<input type="hidden" name="xuanze_num" value="${paper.xuanze_num}" />
					        	</td>
					        </tr>
					        <c:forEach items="${xuanzeList}" var="xuanze" varStatus="status">
							<tr>
					        	<td class="row_name" colspan="5">
					        		<c:out value="${status.index + 1}" />.&nbsp;(${xuanze.score}分)&nbsp;
					        		${xuanze.description}
					        	</td>
							</tr>
							<tr>
								<td></td>
					        	<td class="row_name" colspan="3">
					        		<input type="radio" name="user_answer_${status.index}" value="0"/>A. ${xuanze.answer_a}
					        		<br/>
									<input type="radio" name="user_answer_${status.index}" value="1"/>B. ${xuanze.answer_b}
									<br/>
									<input type="radio" name="user_answer_${status.index}" value="2"/>C. ${xuanze.answer_c}
									<br/>
									<input type="radio" name="user_answer_${status.index}" value="3"/>D. ${xuanze.answer_d}
					        	</td>
					        	<td class="important_message">
					        		<div id="xuanze_${status.index}" style="display:none">
					        		正确答案：
				 					<c:if test="${xuanze.right_answer_pos == 0}">A</c:if>
				 					<c:if test="${xuanze.right_answer_pos == 1}">B</c:if>
				 					<c:if test="${xuanze.right_answer_pos == 2}">C</c:if>
				 					<c:if test="${xuanze.right_answer_pos == 3}">D</c:if>
				 					</div>
					        	</td>
							</tr>
							</c:forEach>
							<tr><td><br/></td></tr>
					        <tr>
					        	<td class=row_question_type colspan="5">
					        		三、填空题(共${paper.tiankong_num}题)：
					        		<input type="hidden" name="tiankong_num" value="${paper.tiankong_num}" />
					        	</td>
					        </tr>
					        <c:forEach items="${tiankongList}" var="tiankong" varStatus="status">
							<tr>
					        	<td class="row_name" colspan="5">
					        		<c:out value="${status.index + 1}" />.&nbsp;(${tiankong.score}分)&nbsp;
					        		${tiankong.description_before}
					        		<input type="text" name="user_answer_${status.index}"/>
									${tiankong.description_after}
					        	</td>
							</tr>
							<tr>
					        	<td class="row_name" colspan="4">
					        	<td class="important_message">
					        		<div id="tiankong_${status.index}" style="display:none">
					        		正确答案：
				 					${tiankong.correct_answer}
				 					<c:if test="${tiankong.synonym_one != null && tiankong.synonym_one != ''}">, ${tiankong.synonym_one}</c:if>
				 					<c:if test="${tiankong.synonym_two != null && tiankong.synonym_two != ''}">, ${tiankong.synonym_two}</c:if>
				 					<c:if test="${tiankong.synonym_three != null && tiankong.synonym_three != ''}">, ${tiankong.synonym_three}</c:if>
				 					</div>
					        	</td>
							</tr>
							</c:forEach>
						</table>
					</DIV>
				</UL>
				<UL class=subnav_ul3></UL>
			</DIV>
		</DIV>
	</DIV>

    <%@ include file="../footer.jsp" %>
  </body>
</html>
